"""
@project: PyCharm
@author: MZM
@file: forms.py
@ide: PyCharm
@time: 2021/8/1 17:24
@desc： 
"""
from django import forms
from import_export.forms import ImportForm, ConfirmImportForm

from .models import *

class ApiImportForm(ImportForm):
    '''
    导入预览时可以给用户选择的字段
    '''
    project = forms.ModelChoiceField(
        queryset=Project.objects.all(),
        required=True)
    header = forms.ModelMultipleChoiceField(
        queryset=Header.objects.all(),
        required=False
    )


class ApiConfirmImportForm(ConfirmImportForm):
    '''
    导入操作时可以给用户选择的字段
    '''
    project = forms.ModelChoiceField(
        queryset=Project.objects.all(),
        required=True)
    header = forms.ModelMultipleChoiceField(
        queryset=Header.objects.all(),
        required=False
    )